package combat.settlement.calculate.strategies;

import combat.settlement.calculate.DiscountStrategy;

/**
 * @author Seon
 * @version 1.0
 * @since 2024-09-03
 */
public class ThresholdDiscount implements DiscountStrategy {

    private final double threshold;

    private final double discountAmount;

    public ThresholdDiscount(double threshold, double discountAmount) {
        this.threshold = threshold;
        this.discountAmount = discountAmount;
    }

    @Override
    public double applyDiscount(double price) {
        if (price >= threshold) {
            price -= discountAmount;
        }
        return price;
    }
}
